package cmd

import (
	"fmt"

	"gitee.com/lcc_dr/restful-api-demo/version"
	"github.com/spf13/cobra"
)

// var vers bool

// RootCmd represents the base command when called without any subcommands
var versionCmd = &cobra.Command{
	Use:   "version",
	Short: "Print the version number of Host",
	Long:  `All software has versions. This is HostService's`,
	RunE: func(cmd *cobra.Command, args []string) error {
		// if vers {
		fmt.Println(version.FullVersion())
		return nil
		// }
		// return nil
	},
}

func init() {
	rootCmd.AddCommand(versionCmd)
}
